﻿using System;
using System.Collections.Generic;
using System.Text;

namespace X3DLib
{
    public class Shape:X3DObject
    {
        private Appearance Appearance;

        public Appearance appearance
        {
            get { return Appearance; }
            set { Appearance = value; }
        }
        private Geometry Geometry;

        public Geometry geometry
        {
            get { return Geometry; }
            set { Geometry = value; }
        }

        public Shape():base()
        {
            
        }

        public Shape(string USE)
            : base()
        {
            this.USE = USE;
        }

        public Shape(Appearance Appearance,Geometry Gemeotry)
            : base()
        {
            this.Appearance = Appearance;
            this.Geometry = Gemeotry;
        }
        public override string getAttrs()
        {
            return  "DEF|" + this.DEF + "|string,"
                + "USE|" + this.USE + "|string";
        }
        public override void setAttrs(string attrs)
        {
            string[][] temp = X3DString.getArrayByAttrs(attrs);
            for (int i = 0; i < temp.Length; i++)
            {
                switch (temp[i][0])
                {
                    case "DEF":
                        this.DEF = temp[i][1];
                        break;
                    case "USE":
                        this.USE = temp[i][1];
                        break;
                }
            }
        }
    }
}
